<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>正在拉取微信用户信息</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
</head>
<body>
<h1>正在拉取微信用户信息请你稍后...........</h1>
</body>
<script src="../js/mui.min.js"></script>
<script src="../js/practise/push.js"></script>
<script src="../js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/cookieutil.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/getUrlParam.js"></script>
<script>
    $(function(){
        var code=getUrlParam("code");
        if (code!=null&&code!=undefined)
        {
            mui.post('/wxlogin/login', {
                    code:code
                },function(data){
                var  userdto=data.object;
                    console.log(data);
                    if (userdto.id>0&&userdto.id!=undefined){
                        setCookie('userdto', userdto);
                        setCookie('userid', userdto.id);
                        setCookie('username', userdto.username);
                        setCookie('openid', userdto.openid);
                        setCookie('upopenid', userdto.upopenid);
                        setCookie('materielA', userdto.materielA);
                        setCookie('materielB', userdto.materielB);
                        setCookie('avatar', userdto.avatar);
                        setCookie('level', userdto.level);
                        setCookie('money', userdto.money);
                        setCookie('mobile', userdto.mobile);
                        window.location.href =topath()+"view/adlist.html";
                    }
                },'json'
            );
        }
    });
</script>
</html>
